
<%@page import="java.util.List"%>
<%@page import="com.wre.factory.PropertyTypeDaoFactory"%>
<%@page import="com.wre.dao.PropertyTypeDao"%>
<%@page import="com.wre.dto.Property"%>
<%@page import="com.wre.dao.AddressDao"%>
<%@page import="com.wre.factory.AddressDaoFactory"%>
<%@page import="com.wre.dto.PropertiesList"%><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title> </title>
<link href="default.css" rel="stylesheet" type="text/css" media="screen" />

<style type="text/css">
        body { font-family:Arial, Helvetica, Sans-Serif; font-size:0.8em;}
        #report { border-collapse:collapse;}
        #report h4 { margin:0px; padding:0px;}
        #report img { float:right;}
        #report ul { margin:10px 0 10px 40px; padding:0px;}
        #report th { background:#7CB8E2 url(header_bkg.png) repeat-x scroll center left; color:#fff; padding:1px 15px; text-align:left;}
        #report td { background:#C7DDEE none repeat-x scroll center left; color:#000; padding:7px 15px; }
        #report tr.odd td { background:#fff url(row_bkg.png) repeat-x scroll center left; cursor:pointer; }
        #report div.arrow { background:transparent url(images/arrows.png) no-repeat scroll 0px -16px; width:16px; height:16px; display:block;}
        #report div.up { background-position:0px 0px;}
    </style>
    <script src="js/jquery.js" type="text/javascript"></script>
    <script type="text/javascript">  
        $(document).ready(function(){
            $("#report tr:odd").addClass("odd");
            $("#report tr:not(.odd)").hide();
            $("#report tr:first-child").show();
            
            $("#report tr.odd").click(function(){
                $(this).next("tr").toggle();
                $(this).find(".arrow").toggleClass("up");
            });
            //$("#report").jExpand();
        });
    </script>
</head>
<body>

<jsp:include page="/header.jsp" />

<div id="wrapper">
	<!-- start page -->
	<div id="page">
		<jsp:include page="/sideMenuLeft.jsp" />
		<!-- start content -->
		<div id="content">			
			<div class="post">
				<h1 class="title">Property List</h1>
				<p class="byline"><br ></p>
				<div class="entry">
					<table id="report">
        <tbody>
        <tr style="display: table-row;">
        	<th>Property Name</th>
            <th>Property Type</th>
            <th>Location</th>
            <th>Area in sqft</th>
            <th>Cost</th>                      
            <th></th>
        </tr>
        <%
        List propList = (List)request.getAttribute("propList");   
       
        for(int i=0;i<propList.size();i++)
        {
        	PropertiesList propertiesList=(PropertiesList) propList.get(i);
        	
        	String propertyName = propertiesList.getPropertyName();
        	String propertyType=propertiesList.getPropertyType();
        	String location=propertiesList.getLocation();
        	String cost=propertiesList.getCost();
        	String area=propertiesList.getArea();
        	String photoPath=propertiesList.getPhotoPath();        	
        	String photoLoc=basePath+photoPath;    
        	System.out.print(photoLoc);
        	String contactName=propertiesList.getContactName();
        	String contactNumber1=propertiesList.getContactNumber1();
        	String contactNumber2=propertiesList.getContactNumber2();
        	String city=propertiesList.getCity();
        %>
        <tr class="odd">
            <td><%= propertyName%> </td>
            <td><%= propertyType%> </td>
            <td><%=location %></td>
            <td align="center"><%=area %> </td>  
            <td><%=cost %></td>          
            <td><div class="arrow"></div></td>
        </tr>
        
        <tr style="display: none;">
            <td colspan="5"><br />
                 <img src=<%=photoLoc%> alt="Property Photo" width="100" height="100" />
                <h4>Personal information</h4>
                <ul>
                    <li>Contact Name : <%=contactName%></li>
                    <li>City : <%=city%></li>
                    <li>Contact Number: <%=contactNumber1%> , <%=contactNumber2%></li>
                 </ul>   
            </td>
        </tr>
        <%
        }
        %>       
    </tbody></table>
				</div>
			</div>
			
		</div>
		<!-- end content -->
		<!-- start sidebars -->
		<jsp:include page="/sideMenuRight.jsp" />
		<!-- end sidebars -->
		<div style="clear: both;">&nbsp;</div>
	</div>
	<!-- end page -->
</div>
<jsp:include page="/footer.jsp" />
</body>
</html>


























